package com.javasm.gg.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.javasm.gg.*;
import com.javasm.gg.dao.BrandDao;
import com.javasm.gg.dao.GoodsTypeDao;
import com.javasm.commons.enums.E;
import com.javasm.commons.exceptions.MvcException;
import com.javasm.gg.dao.ProductDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductServiceImpl extends ServiceImpl<ProductDao, Product> implements ProductService {
    @Override
    public List<Product> getProByPage(Product pro) {
        List<Product> proByPage = super.baseMapper.getProByPage(pro);
        if (proByPage.size()==0) throw new MvcException(E.NOT_EXISTS);
        return proByPage;
    }

    @Override
    public List<String> getAllCode() {
        return super.baseMapper.getAllCode();
    }

}
